package com.fzrskj.cloud.free.core.enums;

/**
 * DomainRealNameStatusEnum.
 *
 * @author wzj.
 *         Created on 2018/08/28 0001.
 */
public enum DomainRealNameStatusEnum {
    /**
     * 未实名
     */
    REAL_PENDING(1,"未实名"),
    /**
     *  审核中.
     */
    REAL_PROCESSING(2, "审核中") ,
    /**
     *  实名失败.
     */
    REAL_FAIL(3,"实名失败") ,
    /**
     *  已实名.
     */
    REAL_SUCCESS(4,"已实名"),
    /**
     *  已实名.
     */
    REAL_LOCAL_SAVE_FILE(5,"本地保存证件") ;

    /**
     * 状态码.
     */
    private int status;


    /**
     * 状态.
     */
    private String statusName;

    /**
     * construct.
     * @param status 值.
     */
    DomainRealNameStatusEnum(Integer status) {
        this.status = status;
    }

    /**
     * construct.
     * @param status 值.
     */
    DomainRealNameStatusEnum(Integer status, String statusName) {
        this.status = status;
        this.statusName = statusName;
    }

    /**
     * get status.
     * @return status.
     */
    public Integer getStatus() {
        return this.status;
    }

    /**
     * 获取状态名称.
     * @return statusName.
     */
    public String getStatusName() {
        return this.statusName;
    }


    /**
     * 通过状态值获取状态名称.
     * @param status value.
     * @return status name.
     */
    public static String getStatusName(Integer status) {
        for (DomainRealNameStatusEnum item : DomainRealNameStatusEnum.values()) {
            if (item.getStatus().equals(status)) {
                return item.getStatusName();
            }
        }
        return null;
    }
}
